<template>
	<view class="page">
		<image class="bg" src="../../static/images/other/boxBg.png" mode="widthFix"></image>
		<view class="topBox">
			<view class="icon" @click="goBack()">
				<u-icon name="arrow-left" color="#000" size="50"></u-icon>
			</view>
			<!-- <text>分享</text> -->
		</view>
		<view class="pageTitle">
			<view class="whiteText" v-for="(item,index) in titleTextArr" :key="index">
				<view class="">
					{{item}}
					<view class="blackText">
						{{item}}
					</view>
				</view>
			
			</view>
		</view>
		<view class="activeTipsBox">
			<view class="left-box">
				{{boxDetail.group_name}}
			</view>
			<view class="right-box">
				{{boxDetail.group_content}}
			</view>
		</view>
		<view class="periodNum" v-if="boxInfo.now_term_number">
			第 <text class="periodNumText">{{boxInfo.now_term_number}}</text> 期
		</view>
		<view class="tipsBox">
			<view class="page-box" @click="goPage('/pages/theBestBox/joinRecord')">
				<image  class="pageIcon" src="../../static/images/other/item5.png" mode=""></image>
				<view class="text">
					拆盒记录
				</view>
			</view>
			<view class="massage">
				<uni-transition  v-if="massageShow" ref="massageAnimationItem" :duration="4000"  :show="massageShow" mode-class="slide-right">
					<view class="messageItem">
						<image class="cover" :src="massageObj.headimg" mode=""></image>
						<text>{{massageObj.prize_desc}}</text>
					</view>
				</uni-transition>
			</view>
			<view class="page-box" @click="goPage('/pages/theBestBox/rules/rules',{id: boxId})">
				<image class="pageIcon" src="../../static/images/other/item4.png" mode=""></image>
				<view class="text">
						拆盒规则
				</view>
			</view>
		</view>
		<view class="theBestBoxArr" @click="restoreArrLocation" >
			
			<view class="" >
				<view :class="theBestBoxArr.length > 6 ? 'item' : 'item2'" v-for="(item,index) in theBestBoxArr" :key="index">
					<uni-transition ref="animationItem" :duration="300*(index+1)" :show="theBestBoxShow" :mode-class="modeClass">
						<view class="itemBox" @click.stop="openBox(index,item.box_id)">
							<view class="indexNum">
								{{item.box_id}}
							</view>
							<image class="boxImg" :src="item.img" mode="heightFix"></image>
						</view>
					</uni-transition>
				</view>
			</view>
				
				<view class="tips" v-if="startActive==1">
					<u-circle-progress active-color="#fe5e10" inactive-color="#D2D2D2" :percent="boxInfo.rate ? boxInfo.rate : 0 "  :duration="800" :width="70" :border-width="7" bg-color="#ebebe">
							<view class="u-progress-content">
								<text class='u-progress-info'>{{boxInfo.rate_text}}</text>
							</view>
					</u-circle-progress>
					<text>{{boxInfo.surplus_number_text}}</text>
				</view>
				
				<view class="tips" v-if="startActive==2">
					<text style="color:#fe5e10;">活动在{{this.boxDetail.start_time_text}}开启</text>
				</view>
				
				<view class="tips" v-if="startActive==3">
					<text style="margin-left: 30rpx;color: #808080;">活动已结束</text>
				</view>
		</view>
		
		<view class="bottomBg">
			<view class="tab">
				<view class="typeArr">
					<view class="typeItem" v-for="(item,index) in tabArr" :key="item.id" @click="changeTabType(index)">
						<view :class="item.id==tabIndex ? 'activeText' : '' ">
							{{item.text}}
						</view>
					</view>
				</view>
			</view>
			<view class="tabContent">
				<view class="content1"  v-if="tabIndex==0">
					<view class="arr" v-if="joinList.length" >
						<view :class="mid==item.member_id ? 'activeColor arrItem' : 'arrItem' " v-for="(item,index) in joinList" :key="index">
							<image :src="item.headimg" mode=""></image>
							<view class="desc">
								<view class="name">
									{{item.nickname}}
								</view>
								<view class="time">
									参与时间：{{item.create_time_text}}
								</view>
							</view>
							<view class="money" >
								{{item.status_text}}
							</view>
						</view>
					</view>
					
					<view class="empty" v-if="!joinList.length" >
						<image src="../../static/images/other/boxItem3.png" mode=""></image>
						<text>去选一个盒子拆开吧!</text>
					</view>
					
				</view>
				
				<view class="content1"   v-if="tabIndex==1">
					<view class="arr"  >
						<view class="arrItem" v-for="(item,index) in historyArr" :key="index" @click="junit('/pages/theBestBox/joinRecordDetail',{term_id: item.id})">
							<view class="desc">
								<view class="name">
									第<text class="periodNumText">{{item.term_number}}</text>期
								</view>
								<view class="time">
									{{item.create_time_text}}
								</view>
							</view>
							<view class="btn" >
								{{item.status_text}} <u-icon name="arrow-right" color="$themeColor" size="26"></u-icon>
							</view>
						</view>
						<noMore v-if="!historyArr.length"></noMore>
					</view>
					
					<view class="empty" v-if="false" >
						<image src="../../static/images/other/boxItem3.png" mode=""></image>
						<text>去选一个盒子拆开吧!</text>
					</view>
					
				</view>
				
				<view class="content1"  v-if="tabIndex==2">
					<view class="goodsTips">
						<view class="icon">
							?
						</view>
						<text>
							{{boxDetail.tips}}
						</text>
					</view>
					<view class="goodsDetail">
						<u-parse :html="boxDetail.goods_content"></u-parse>
					</view>
					
				</view>
				
				
			</view>
		</view>
	
	<!-- 红包 -->
	<redEnvelope ref="redEnvelope" @goLuckyDraw="goLuckyDraw"></redEnvelope>
		
	<!-- 选择支付方式 start -->
	<bottomPopup ref="selectPay">
		<view class="selectPay">
			<view class="title">
				请选择支付方式
			</view>
			<view class="selectArr">
				<view class="selectItem" v-for="(item,index) in selectPayArr" :key="index">
					<image :src="item.img" mode=""></image>
					<view class="label">
						{{item.label}}
					</view>
					<view class="right-box" @click="changeSelectPay(index)">
						<u-switch  disabled activeColor="#ff652e" inactiveColor="#E5E5E5" v-model="item.val" ></u-switch>
					</view>
				</view> 
			</view>
			<view class="btn" @click="goPay">
				立即支付 ￥{{ boxDetail.price}}
			</view>
		</view>
	</bottomPopup>
	<!-- 选择支付方式 end -->	
	
	<!-- 中奖 -->	
	<u-mask :show="winningShow">
			<view class="warp">
				<uni-transition ref="winningShowAnimation" :duration="1500" :show="winningShow" :mode-class="modeClass">
				<view class="rect">
					<view class="close-btn" @click="winningShow=false">
								<icon type="cancel" color="#fbd977" size="28" />
					</view>
					<image class="bgImg" src="../../static/images/other/tanchuang.png" mode="widthFix"></image>
					<view class="content-box">
						<view class="goodItem">
							<view class="cover">
								<image class="goodImg" :src="winningGoods.img" mode=""></image>
							</view>
							<view class="info">
								<view class="name">
									{{winningGoods.name}}
								</view>
								<view class="price">
									价值￥{{winningGoods.price}}
								</view>
							</view>
						</view>
						<view class="btn" @click="confirmAddressShow = true">
							我要发货
						</view>
						<!-- <view class="btn btn2" @click.stop="confirmBarter()" > -->
						<view class="btn btn2" @click.stop="yihuoConfirmShow=true" >
							我要易货
						</view>
					</view>
				</view>
				</uni-transition>
			</view>
	</u-mask>	
		
	<u-modal title="请选择发货地址" v-model="confirmAddressShow" @confirm="confirmAddress"  show-cancel-button :mask-close-able="true">
		<scroll-view scroll-y="true" style="height: 600rpx;" >
			<view class="slot-content">
				<view class="address-list" v-for="address in addressList" :key="address.id" @click="selectAddress(address)">
					<view :class="selectAddressObj.id == address.id ? 'icon activeIcon' : 'icon' " >
					</view>
					<view class="top u-flex">
						<text class="name">{{ address.name }}</text>
						<text class="phone">{{ address.mobile }}</text>
						<text class="tag" v-show="address.is_default==1">默认</text>
					</view>
					<view class="detail">
						{{ address.full_address }}{{address.address}}
					</view>
				</view>
				<view v-if="!addressList.length" class="tips" @click="goPage('/pages/prefile/address/list')" style="color: #F70909;margin-top: 200rpx;" >
					您还未完善收件信息，点击去完善
				</view>
			</view>
		</scroll-view>
		
	</u-modal>	
	
		
	<!-- 易货确认 -->
	<u-mask :show="yihuoConfirmShow">
			<view class="yihuoWarp">
				<view class="box">
					<view class="title">
						易货
					</view>
					<view class="good">
						<image :src="winningGoods.img" mode=""></image>
						<view class="desc">
							<view class="name">
								{{winningGoods.name}}
							</view>
							<view class="price">
								￥{{winningGoods.price}}
							</view>
						</view>
					</view>
					<view class="point">
						<image src="../../static/images/other/change.png" mode=""></image>
						易货可获得 {{winningGoods.point}} 积分
					</view>
					<view class="tips">
						确认易货后，此商品会转换成积分，积分可以 在兑换商城兑换商品，或者参与抽奖。确认后 不可撤销，请谨慎操作
					</view>
					<view class="bottomBtns">
						<view class="btnItem" @click="yihuoConfirmShow = false">
							取消
						</view>
						<view class="btnItem" @click="confirmBarter()">
							确认
						</view>
					</view>
				</view>
			</view>
	</u-mask>
		
	<!-- 易货成功 -->
	<u-mask :show="yihuoSuc">
			<view class="yihuoWarp">
				<view class="box">
					<view class="title">
						易货成功
					</view>
					<view class="sucPoint">
						<image src="../../static/images/other/jifen.png" mode=""></image>
						<text>获得 {{winningGoods.point}} 积分</text>
					</view>
					<view class="tips">
						积分可以在兑换商城兑换，或者参与抽奖。 
					</view>
					<view class="confirmBtn" @click="yihuoSuc=false">
							确认
					</view>
				</view>
			</view>
	</u-mask>	
		
	</view>
</template>

<script>
	import bottomPopup  from "@/components/bottom-popup/bottom-popup.vue"
	import redEnvelope  from "@/components/redEnvelope/redEnvelope.vue"
	import noMore  from "@/components/noMore/noMore.vue"
	let timeObj = {}
	
	export default {
		data() {
			return {
				confirmAddressShow : false,
				mid: '',
				addressList:[ ],
				selectAddressObj:{},
				titleTextArr:[
					'臻','品','盒','精','品','团'
				],
				theBestBoxShow :true,
				modeClass:[
					'fade',
					'slide-top'
				],
				selectIndex : undefined,
				payedBoxImg: '../../static/images/other/boxItem2.png',
				theBestBoxArr:[	],
				tabArr:[
					{
						id: 0 ,
						text: '参与列表'
					},
					{
						id: 1 ,
						text: '往期开奖'
					},
					{
						id: 2 ,
						text: '商品说明'
					},
				],
				tabIndex: 0,
				boxId: '',
				boxDetail: {},
				socketObj:{},
				boxInfo:{ },
				selectPayArr:[
					{
						label: '微信支付',
						val: false,
						img: '../../static/images/other/wxpay.png',
					},
					{
						label: '余额支付(可用:￥0.00)',
						val: true,
						img: '../../static/images/other/walletpay.png',
					},
					// {
					// 	label: '是否使用盲盒积分(可用:1250)',
					// 	id: '0',
					// 	val: true,
					// },
				],
				selectBox_id: '',
				joinList:[],//参与列表
				historyArr:[],
				balance:'',
				winningShow: false,
				winningGoods:{
					id:'',
					name: '',
					price:'',
					img:'',
					prize_id: '',
					point : '',
				},
				newsArr:[],//中奖消息
				massageObj:{},
				massageShow:false,
				startActive : 0,//1 进行中 2 未开始 3 已结束
				yihuoConfirmShow: false,
				yihuoSuc : false,
			};
		},
		methods:{
			// yihuoShow(_item){
			// 	this.yihuoConfirmShow = true
			// 	this.goodsObj = _item
			// },
			// 易货
			confirmBarter(){
				this.myHttp({
					url: '/surpriseblindbox/api/Blindbox/pointBarter',
					data:{
						prize_id : this.winningGoods.prize_id,
					}
				}).then(res=>{
					if(res.code==0){
						// uni.showToast({
						//     title: '易货成功',
						//     duration: 3000,
						// });
						this.winningShow = false
						this.yihuoConfirmShow = false
						this.yihuoSuc = true
					}
					
				})
			},
			// 往期list
			historyTermList(){
				this.myHttp({
					url:'/surpriseblindbox/api/Blindbox/historyTermList',
					data:{
						blindbox_id : this.boxId,
					}
				}).then((res)=>{
					this.historyArr = res.data.list
				})
			},
			goPay(){
				let pay_type
				if(this.selectPayArr[0].val){
					pay_type = 1//微信
				}else if(this.selectPayArr[1].val){
					pay_type = 2//余额
				}
				
				if(!pay_type){
					return uni.showToast({
					    title: '请先选择支付方式',
					    duration: 3000,
					    icon: 'none'
					});
				}
				
				// if(pay_type == 2 && Number(this.infoArr[0].num) < Number(this.detailObj.activity_amount)){
				// 	// console.log(this.detailObj.activity_amount);
				// 	// console.log(this.infoArr[0].num);
				// 	return uni.showToast({
				// 	    title: '您的余额不足',
				// 	    duration: 3000,
				// 	    icon: 'none'
				// 	});
				// }
				
				// let use_point = this.selectPayArr[2].val ? 1 : 0
				// //  pay_type=3 积分支付
				// use_point = pay_type == 3 ? 1 : 0
				console.log('发请求');
				console.log(this.selectBox_id);
				this.myHttp({
					url:'/surpriseblindbox/api/pay/blindboxPay',
					data:{
						blindbox_id : this.boxId,
						pay_type,//1 微信 2余额
						box_id : this.selectBox_id,
					}
				}).then((res)=>{
					this.$refs.selectPay.show = false
					this.restoreLocation(this.selectIndex)
				})
			},
			changeSelectPay(_index){
				console.log(_index);
				if(_index != 2){
					this.selectPayArr[_index].val = !this.selectPayArr[_index].val
					if(this.selectPayArr[_index].val == true){
						_index==0 ? this.selectPayArr[1].val = false : this.selectPayArr[0].val = false
					}
					
				}else if(_index == 2){
					this.selectPayArr[2].val = !this.selectPayArr[2].val
				}
			},
			// 红包组件开发时的监听事件
			goLuckyDraw(){
				console.log('打开红包后');
			},
			changeTabType(_index){
				this.tabIndex = _index
				if(this.tabIndex==1){
					this.historyTermList()
				}
			},
			// 打开盒子
			openBox(_index,_boxId){
				if(this.startActive != 1){
					return uni.showModal({
					    title: '提示',
					    content: this.startActive==2 ? `活动未开始，开始时间为${this.boxDetail.start_time_text}` : this.startActive==3 ? '活动已结束' : '',
					    success: function (res) {
					        if (res.confirm) {
					        } else if (res.cancel) {
					        }
					    }
					});
					
				}
				
				// 限制重复参与
				// if(this.joinList.length){
				// 	for (let item of this.joinList) {
				// 		if(item.member_id==this.mid){
				// 			return  uni.showToast({
				// 				title: '请不要重复参与！',
				// 				duration: 3000,
				// 				icon: 'none'
				// 			});
				// 		}
				// 	}
				// }
				
				if(this.selectIndex == _index){
					this.$refs.animationItem[this.selectIndex].run(()=>{
						this.myHttp({
							url:'/api/member/userInfo',
						}).then((res)=>{
							this.selectPayArr[1].label = `余额支付(可用:￥${ res.data.balance})` //余额
							this.balance = res.data.balance
							this.$refs.selectPay.show = true
							// this.amountArr[1].val = res.data.point//积分
						})
					})
					return
				}
				
				this.theBestBoxArr.forEach((item,index)=>{
					this.restoreLocation(index)
				})
				
				this.selectIndex = _index
				this.selectBox_id = _boxId
				
				console.log(_index);
				console.log(this.selectBox_id);
				
				this.$refs.animationItem[this.selectIndex].step({
				    translateY: '-80rpx'
				},{
				    duration: 1000,
				    timingFunction:'ease',
				})
				this.$refs.animationItem[this.selectIndex].run(()=>{
					this.myHttp({
						url:'/api/member/userInfo',
					}).then((res)=>{
						this.selectPayArr[1].label = `余额支付(可用:￥${ res.data.balance})` //余额
						this.balance = res.data.balance
						this.$refs.selectPay.show = true
						// this.amountArr[1].val = res.data.point//积分
					})
				})
			},
			// 恢复位置
			restoreLocation(_index){
				this.$refs.animationItem[_index].step({
				    translateY: '0'
				},{
				    duration: 1000,
				    timingFunction:'ease',
					// delay: 2000,
				})
				this.$refs.animationItem[_index].run(()=>{
					// this.selectBox_id = ''
				    // console.log('恢复位置')
					// this.selectIndex = undefined
				})
			},
			// 数组恢复位置
			restoreArrLocation(){
				this.theBestBoxArr.forEach((item,index)=>{
					this.restoreLocation(index)
				})
			},
			// 详情
			getBoxDetail(){
				this.myHttp({
					url: '/surpriseblindbox/api/Blindbox/detail',
					data : {
						blindbox_id : this.boxId,
					}
				}).then(res=>{
					this.boxDetail = res.data.info
					this.titleTextArr = this.boxDetail.name.split('')
					
					let nowDate = new Date()
					if(nowDate > this.boxDetail.end_time ){
						// 活动结束
						this.startActive = 1
						// this.startActive = 3
					}else if(nowDate < this.boxDetail.start_time){
						// 活动还没开始
						this.startActive = 2
					}else{
						// 进行中
						this.startActive = 1
					}
					
				})
			},
			contentSocket(){
				let that = this
				let socketObj = uni.connectSocket({
					url: `wss://zhenpin.gdxuanbao.com/websocket?token=${uni.getStorageSync('token')}&blindbox_id=${that.boxId}  `,
					success(res){
						console.log(res);
						console.log('socket连接成功');
					},
					fail(err){
						console.log(err);
						console.log('socket连接失败');
					},
				})
				// console.log(socketObj);
				this.socketObj = socketObj
				// 连接打开
				uni.onSocketOpen(function (res) {
				    // console.log('WebSocket打开'); 
					// console.log(res);
				    //断线后重连几次
				    // _this.reconnectCount = 5
				    // // 5秒发送一次心跳
				    // _this.heartbeatInterval = setInterval(()=>{
				    //     _this.sendMsg(new MsgContent({
				    //         name:'PING',
				    //         id:_this.equipmentData.id
				    //     }))
				    // },5000)
				});
				uni.onSocketMessage(function (res) {
					// console.log('收到服务器内容：');
					if(res.data.length){
						let resJSON = JSON.parse(res.data)
						
						if(resJSON.data.handle=='TermUpdate'){
							// 更新数据
							if(resJSON.data.info){
								that.boxInfo = resJSON.data.info
							}
							
							if(resJSON.data.box_list && resJSON.data.box_list.length){
								resJSON.data.box_list.forEach((item)=>{
									if(item.status==1){
										// 已开的盒子
										item.img = '../../static/images/other/boxItem2.png'
									}else if(item.status == 0){
										item.img = '../../static/images/other/boxItem1.png'
									}
									
								})
								that.theBestBoxArr = resJSON.data.box_list
								console.log('当前盒子列表');
								console.log(that.theBestBoxArr);
							}
							if(resJSON.data.list && resJSON.data.list.length){
								that.joinList = resJSON.data.list
								console.log('参与人数');
								console.log(that.joinList);
							}else if(!resJSON.data.list.length){
								that.joinList = []
							}
						}else if(resJSON.data.handle=='DrawPrize'){
							// 开奖
							if(resJSON.data.status==2){
								// 未中奖领取红包
								that.$refs.redEnvelope.money = resJSON.data.hongbao
								that.$refs.redEnvelope.show = true
								that.$refs.redEnvelope.showType = 1
								that.getNewBoxState()//获取最新状态
							}else if(resJSON.data.status==1){
								// 中奖
								that.winningShow = true
								that.winningGoods.id = resJSON.data.goods_id
								that.winningGoods.img = resJSON.data.goods_image
								that.winningGoods.name = resJSON.data.goods_name
								that.winningGoods.price = resJSON.data.price
								that.winningGoods.prize_id = resJSON.data.prize_id
								that.winningGoods.point = resJSON.data.point
								console.log('易货商品');
								console.log(that.winningGoods);
								that.getNewBoxState()//获取最新状态
							}
							
						}
						
						
					}
					
					
				});
			},
			init(){
				this.getBoxDetail()
				this.contentSocket()
				this.getAddressList()
				this.getNews()
			},
			getNews(){
				this.myHttp({
					url: '/surpriseblindbox/api/Blindbox/getWinList',
					data:{
						blindbox_id : this.boxId
					}
				}).then(res=>{
					if(res.data.list.length){
						this.newsArr = res.data.list;
						this.massageShow = true
						let count = 0 
						this.massageObj = this.newsArr[count]
						timeObj = setInterval(()=>{
							if(count==this.newsArr.length-1){
								count=0
							}else{
								count++
							}
							this.massageObj = this.newsArr[count]
							this.massageShow = false
							setTimeout(()=>{
								this.massageShow = true
							},1500)
						},10000)
					}
					
				})
			},
			getAddressList() {
				this.myHttp({
					url: '/api/memberaddress/page',
				}).then(res=>{
					this.addressList = res.data.list;
				})
			},
			confirmAddress(){
				if(!this.selectAddressObj.id){
					if(!this.addressList.length){
						return this.goPage('/pages/prefile/address/list')
					}
					return uni.showToast({
					    title: '请选择地址',
					    duration: 3000,
					    icon: 'none'
					});
				}
				this.myHttp({
					url: '/surpriseblindbox/api/Blindbox/sendGoods',
					data:{
						prize_id : this.winningGoods.prize_id,
						address_id : this.selectAddressObj.id,
					}
				}).then(res=>{
					if(res.code==0){
						uni.showToast({
						    title: '发货成功',
						    duration: 3000,
						});
						this.winningShow = false
					}
				})
			},
			selectAddress(_address){
				this.selectAddressObj = _address
				console.log(this.selectAddressObj);
			},
			// 获取最新状态
			getNewBoxState(){
				this.myHttp({
					url: '/surpriseblindbox/api/Blindbox/getNewTermStatus',
					data:{
						blindbox_id: this.boxId
					}
				}).then(res=>{
				})
			},
		},
		onLoad({boxId}) {
			this.boxId = boxId
			this.mid = uni.getStorageSync('mid')
			this.init()
		},
		onHide() {
			console.log('隐藏');
			// uni.closeSocket({
			// 	success(suc) {
			// 		console.log('关闭成功');
			// 		console.log(suc);
			// 	},
			// 	fail(err) {
			// 		console.log('关闭失败');
			// 		console.log(err);
			// 	},
			// })
			// clearInterval(timeObj)
		},
		onUnload() {
			console.log('销毁页面');
			uni.closeSocket({
				success(suc) {
					console.log('关闭成功');
					console.log(suc);
				},
				fail(err) {
					console.log('关闭失败');
					console.log(err);
				},
			})
			clearInterval(timeObj)
			//  一般页面用onUnload 清楚定时器
		},
		onShow() {
			console.log('onshow');
			// this.init()
			// 监听地址
			// uni.$on('SELECT_ADDRESS', res => {
			// 	console.log(res);
			// });
		},
		components:{
			bottomPopup,redEnvelope,noMore
		},
		filters:{
			
		},
	}
</script>

<style lang="scss" scoped>
.page{
	font-family: PingFang SC;
	width: 100%;
	@include flexCol;
	align-items: center;
	.bg{
		position: fixed;
		top: 0;
		right: 0;
		width: 100%;
		z-index: -1;
	}
	.topBox{
		padding-top: 80rpx;
		padding-right: 20rpx;
		width: 100%;
		display: flex;
		justify-content: space-between;
		.icon{
			width: 100rpx;
			height: 80rpx;
			display: flex;
			align-items: flex-start;
			justify-content: center;
		}
		text{
			
		}
	}
	
	.periodNumText{
		color: #fff;
		background-color: $themeColor;
		border-radius: 5rpx;
		padding: 0 8rpx;
		margin: 0 8rpx;
	}
	
	.pageTitle{
		font-style: italic;
		display: flex;
		.whiteText{
			font-size: 65rpx;
			color: #fff;
			position: relative;
			-webkit-text-stroke: 6rpx #FFFFFF;
			text-stroke: 6rpx #FFFFFF;
			.blackText{
					position: absolute;
					top: 50%;
					left: 50%;
					transform: translate(-50%,-50%);
					font-size: 50rpx;
					color: $themeColor;
					-webkit-text-stroke: 4rpx $themeColor;
					text-stroke: 4rpx $themeColor;
			}
		}
		
	}
	
	.activeTipsBox{
		width: 385rpx;
		height: 54rpx;
		border: 5rpx solid #FFFFFF;
		border-radius: 10rpx;
		margin-top: 10rpx;
		color: #fff;
		font-size: 26rpx;
		display: flex;
		.left-box{
			width: 100rpx;
			height: 100%;
			background-color: $themeColor;
			border-radius: 10rpx 0 0 10rpx ;
			@include flexCenter;
		}
		.right-box{
			flex: 1;
			height: 100%;
			background: #FFDECE;
			border-radius: 0 10rpx 10rpx 0;
			color: $themeColor;
			@include flexCenter;
		}
	}
	.periodNum{
		font-size: 26rpx;
		margin-top: 20rpx;
		
	}
	.tipsBox{
		display: flex;
		width: 100%;
		padding:  0 39rpx;
		.page-box{
			color: $themeColor;
			display: flex;
			flex-direction: column;
			align-items: center;
			.pageIcon{
				width: 76rpx;
				height: 76rpx;
				margin-bottom: 5rpx;
			}
		}
		.massage{
			flex: 1;
			@include flexCenter;
			overflow: hidden;
			.messageItem{
				padding: 10rpx;
				// width: 400rpx;
				display: flex;
				align-items: center;
				// background-color: #f3ece7;
				background: linear-gradient(to right,#f3ece7,#eadbd3);
				border-radius: 40rpx 0 0 40rpx;
				.cover{
					width: 40rpx;
					height: 40rpx;
					border-radius: 50%;
					margin-right: 10rpx;
				}
				text{
					
				}
			}
		}
	}
	
	
	.theBestBoxArr{
		width: 100%;
		height: 650rpx;
		display: flex;
		flex-wrap: wrap;
		position: relative;
		.tips{
			position: absolute;
			padding-left: 10rpx;
			left: 0;
			bottom: 0;
			width: 233rpx;
			height: 83rpx;
			background: #ebebeb;
			border-radius: 0 42rpx  42rpx 0;
			display: flex;
			align-items: center;
			text{
				color: #000;
				font-size: 24rpx;
				margin-left: 5rpx;
			}
			.u-progress-content{
				@include flexCenter;
			}
			.u-progress-info{
				font-size: 16rpx;
				color: $themeColor;
				font-weight: 600;
			}
		}
		.item{
			height:  252rpx;
			width: 197rpx;
			position: absolute;
			.indexNum{
				position: absolute;
				top: 0%;
				left: 35%;
				width: 51rpx;
				height: 51rpx;
				background: #FFFFFF;
				border: 2rpx solid #000000;
				border-radius: 50%;
				@include flexCenter;
				font-size: 30rpx;
				font-family: Impact;
				z-index: 10;
			}
			.itemBox{
				.boxImg{
					height:  252rpx;
					width: 197rpx;
				}
			}
			&:nth-child(1){
					left: 2%;
					top: 35%;
					z-index: 3;
			}
			&:nth-child(2){
					left: 20%;
					top: 49%;
					z-index: 3;
			}
			&:nth-child(3){
					left: 39%;
					top: 62%;
					z-index: 3;
			}
			&:nth-child(4){
					left: 2%+17%;
					top: 35%-13%;
					z-index: 2;
			}
			&:nth-child(5){
					left: 20%+17%;
					top: 49%-13%;
					z-index: 2;
			}
			&:nth-child(6){
					left: 39%+17%;
					top: 62%-13%;
					z-index: 2;
			}
			&:nth-child(7){
				    left: 2%+17%+17%;
				    top:  35%-13%-13%;
			}
			&:nth-child(8){
				    left: 20%+17%+17%;
				    top: 49%-13%-13%;
			}
			&:nth-child(9){
				    left: 39%+17%+17%;
				    top: 62%-13%-13%;
			}
		}
		.item2{
			height:  252rpx;
			width: 197rpx;
			position: absolute;
			.itemBox{
				.boxImg{
					height:  252rpx;
					width: 197rpx;
				}
			}
			.indexNum{
				position: absolute;
				top: 0%;
				left: 35%;
				width: 51rpx;
				height: 51rpx;
				background: #FFFFFF;
				border: 2rpx solid #000000;
				border-radius: 50%;
				@include flexCenter;
				font-size: 30rpx;
				font-family: Impact;
				z-index: 10;
			}
			
			&:nth-child(1){
					left: 10%;
					top: 30%;
					z-index: 3;
			}
			&:nth-child(2){
					left: 28%;
					top: 44%;
					z-index: 3;
			}
			&:nth-child(3){
					left: 47%;
					top: 57%;
					z-index: 3;
			}
			&:nth-child(4){
					left: 10%+17%;
					top: 30%-13%;
					z-index: 2;
			}
			&:nth-child(5){
					left: 28%+17%;
					top: 44%-13%;
					z-index: 2;
			}
			&:nth-child(6){
					left: 47%+17%;
					top: 57%-13%;
					z-index: 2;
			}
		}
		
	}
	
	.bottomBg{
		background-color: #e7cec2;
		.tab{
			margin-top: 20rpx;
			width: 750rpx;
			background: #FFFFFF;
			border-radius: 40rpx 40rpx 0 0;
			.typeArr{
				@include flexBetween;
				.typeItem{
					flex: 1;
					height: 100rpx;
					font-size: 30rpx;
					@include flexCenter;
					color: #838383;
					.activeText{
						color: $themeColor;
						position: relative;
						&::after{
							content: '';
							position: absolute;
							left: 50%;
							transform: translateX(-50%);
							bottom: -40%;
							width: 80%;
							height: 8rpx;
							background: $themeColor;
							border-radius: 4rpx;
						}
					}
				}
			}
		}
		.tabContent{
			background-color: #fff;
			min-height: 347rpx;
			.content1{
				@include flexCol;
				align-items: center;
				min-height: 347rpx;
				.goodsTips{
					margin-top: 30rpx;
					width: 700rpx;
					height: 84rpx;
					background: #FFEED4;
					opacity: 0.56;
					border-radius: 10rpx;
					display: flex;
					padding: 20rpx;
					color: $themeColor;
					display: flex;
					align-items: center;
					.icon{
						width: 35rpx;
						height: 35rpx;
						border-radius: 50%;
						border: 2rpx solid $themeColor;
						@include flexCenter;
						margin-right: 20rpx;
					}
					text{
						flex: 1;
						font-size: 20rpx;
					}
					
				}
				.arr{
					display: flex;
					flex-direction: column;
					align-items: center;
					width: 750rpx;
					background: #FFFFFF;
					border-radius: 30rpx;
					.activeColor{
						background-color: #FFEFE7;
					}
					.arrItem{
						display: flex;
						align-items: center;
						height: 156rpx;
						width: 100%;
						padding: 0 25rpx;
						position: relative;
						&::after{
							content: '';
							position: absolute;
							bottom: 0;
							left: 50%;
							width: 90%;
							height: 2rpx;
							background-color: #eee;
							transform: translateX(-50%);
						}
						
						image{
							width: 79rpx;
							height: 79rpx;
							border-radius: 50%;
							margin-right: 29rpx;
						}
						.desc{
							font-size: 24rpx;
							flex: 1;
							display: flex;
							flex-direction: column;
							justify-content: space-around;
							.name{
								display: flex;
								align-items: center;
								font-size: 28rpx;
								color: #000;
								.symbol{
									margin-left: 10rpx;
									width: 62rpx;
									height: 31rpx;
									background: $themeColor;
									border-radius: 5rpx;
									font-size: 21rpx;
									color: #fff;
									display: grid;
									place-items: center;
								}
							}
							.time{
								margin-top: 10rpx;
								color: #A5A5A5;;
							}
							
						}
						.money{
							font-size: 30rpx;
							color: #CFA972;
						}
						.btn{
							@include flexCenter;
							width: 124rpx;
							height: 60rpx;
							background: #FFF5E7;
							border-radius: 5rpx;
							font-size: 27rpx;
							color: $themeColor;
							line-height: 36rpx;
						}
						
					}
				}
				.empty{
					@include flexCol;
					align-items: center;
					justify-content: center;
					margin-top: 30rpx;
					image{
						width: 262rpx;
						height: 198rpx;
						margin-bottom: 15rpx;
					}
					text{
						color: #A5A5A5;
						font-size: 26rpx;
					}
				}
				.goodsDetail{
					margin-top: 40rpx;
				}
			
			}
		}
	}
	
}
</style>
<style lang="scss" scoped>
	.yihuoWarp {
		display: flex;
		align-items: center;
		justify-content: center;
		height: 100%;
		.box{
			width: 75vw;
			height: 639rpx;
			background: #FFEFE7;
			border: 8rpx solid #FE5E10;
			border-radius: 20rpx;
			@include flexCol;
			align-items: center;
			.title{
				width: 100%;
				padding: 47rpx 0;
				color: $themeColor;
				@include flexCenter;
			}
			.sucPoint{
				@include flexCol;
				align-items: center;
				image{
					width: 124rpx;
					height: 124rpx;
					margin: 30rpx 0;
				}
				text{
					color: $themeColor;
				}
			}
			.good{
				width: 90%;
				height: 139rpx;
				background: #FFFFFF;
				display: flex;
				border-radius: 10rpx;
				padding: 18rpx;
				image{
					width: 100rpx;
					height: 100rpx;
					margin-right: 20rpx;
				}
				.desc{
					font-size: 28rpx;
					@include flexCol;
					justify-content: space-between;
					.name{
						color: #222020;
					}
					.price{
						color: #979797;
					}
				}
			}
			.point{
				width: 90%;
				height: 57rpx;
				background: #FFD2BC;
				display: flex;
				align-items: center;
				border-radius: 10rpx;
				margin: 16rpx 0;
				image{
					width: 41rpx;
					height: 41rpx;
					margin-right: 20rpx;
				}
				color: $themeColor;
			}
			.tips{
				width: 90%;
				margin: 30rpx 0;
				color: #979797;
				font-size: 24rpx;
				text-align: center;
			}
			.confirmBtn{
				color: #fff;
				background-color: $themeColor;
				@include flexCenter;
				width: 95%;
				padding: 20rpx 0;
				border-radius: 20rpx;
				margin-top: 50rpx;
			}
			.bottomBtns{
				display: flex;
				justify-content: space-between;
				width: 95%;
				.btnItem{
					width: 45%;
					height: 74rpx;
					background: #FFDFCF;
					border-radius: 10rpx;
					@include flexCenter;
					font-size: 33rpx;
					color: #FE5E10;
					&:nth-child(2){
						color: #fff;
						background-color: $themeColor;
					}
				}
			}
		}
	}
	.slot-content{
		@include flexCol;
		align-items: center;
		.address-list {
			position: relative;
			margin-top: 20rpx;
			width: 80%;
			height: 155rpx;
			border-radius: 20rpx;
			@include flexCol;
			justify-content: center;
			padding-left: 40rpx;
			border: 2rpx solid #EBEEF5;
			.activeIcon{
				background-color: $themeColor;
			}
			.icon{
				position: absolute;
				top: 50%;
				transform: translateY(-50%);
				left: -8%;
				width: 20rpx;
				height: 20rpx;
				border-radius: 50%;
				&::after{
					content: '';
					position: absolute;
					top: 50%;
					left: 50%;
					transform: translate(-50%,-50%);
					width: 35rpx;
					height: 35rpx;
					border: 3rpx solid #eee;
					border-radius: 50%;
				}
			}
			.name {
				font-size: 30rpx;
				font-weight: 600;
			}
		
			.phone {
				font-size: 30rpx;
				margin: 0 20rpx;
			}
		
			.tag {
				background: rgba(233, 191, 113, 0.2);
				border-radius: 6rpx;
				padding: 0 16rpx;
				line-height: 38rpx;
				color: #a8700d;
				font-size: 22rpx;
			}
		
			.detail {
				margin-top: 25rpx;
				width: 543rpx;
				font-size: 26rpx;
		
				font-weight: 400;
				color: rgba(153, 153, 153, 1);
				line-height: 40rpx;
			}
		
		}
	}
	
	.warp {
		display: flex;
		align-items: center;
		justify-content: center;
		height: 100%;
	}
	
	.rect {
		width: 600upx;
		height: 800upx;
		position: relative;
		@include flexCenter;
		.close-btn{
			position: absolute;
			bottom: -10%;
			left: 50%;
			transform: translateX(-50%);
			width: 60rpx;
			height: 60rpx;
			border-radius: 50%;
			background-color: #fff;
			border: 3rpx solid #eee;
			@include flexCenter;
		}
		.bgImg{
			z-index: -1;
			width: 600rpx;
			position: absolute;
		}
		.content-box{
			margin-top: 280rpx;
			.goodItem{
				width: 450rpx;
				height: 163rpx;
				background: #FFFFFF;
				border-radius: 20rpx;
				padding: 13rpx 15rpx;
				display: flex;
				margin-bottom: 50rpx;
				.cover{
					width: 138rpx;
					height: 138rpx;
					.goodImg{
						// width: 100%;
						width: 138rpx;
						height: 138rpx;
						// z-index: 10;
					}
				}
				.info{
					flex: 1;
					padding-left: 20rpx;
					height: 100%;
					@include flexCol;
					.name{
						flex: 1;
						color: #000000;
						font-size: 26rpx;
					}
					.price{
						color: #8C8C8C;
						font-size: 24rpx;
					}
				}
				
				
			}
			.btn{
				width: 450rpx;
				height: 85rpx;
				background: #F22315;
				border-radius: 20rpx;
				@include flexCenter;
				color: #FFF;
				margin-top: 25rpx;
			}
			.btn2{
				background: #fff;
				color: #F22315;
				z-index: 11;
			}
			
		}
	}
	
	
	/deep/ .u-switch--disabled{
		opacity: 1;
	}
	
	.selectPay{
		display: flex;
		flex-direction: column;
		align-items: center;
		width: 750rpx;
		height: 530rpx;
		background: #FFFFFF;
		border-radius: 20rpx;
		padding: 40rpx 0rpx;
		.title{
			width: 100%;
			display: grid;
			place-items: center;
			font-size: 35rpx;
			font-weight: 600;
			color: #000;
		}
		.selectArr{
			flex: 1;
			width: 100%;
			padding: 0 40rpx;
			display: flex;
			flex-direction: column;
			justify-content: space-around;
			.selectItem{
				display: flex;
				align-items: center;
				// justify-content: space-between;
				image{
					width: 50rpx;
					height: 50rpx;
				}
				.label{
					color: #000000;;
					font-weight: 600;
					font-size: 32rpx;
					flex: 1;
					margin-left: 37rpx;
				}
				.right-box{
				}
			}
		}
		.btn{
			width: 750rpx;
			height: 102rpx;
			background: #FF652E;
			// border-radius: 51rpx;
			display: grid;
			place-items: center;
			font-size: 32rpx;
			color: #FFFFFF;
		}
	}
</style>